"use strict";
cc._RF.push(module, '27748HNsMZAVp9/xdiGyun9', 'showTime');
// script/game/showTime.ts

Object.defineProperty(exports, "__esModule", { value: true });
/*
 * @Author: your name
 * @Date: 2021-10-14 14:00:19
 * @LastEditTime: 2021-10-14 16:03:26
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Alive-master\assets\script\game\showTime.ts
 */
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var ShowTime = /** @class */ (function (_super) {
    __extends(ShowTime, _super);
    function ShowTime() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**文本 */
        _this._label = undefined;
        /**显示时间 */
        _this._show = 3;
        /**时间 */
        _this._time = 0;
        return _this;
    }
    ShowTime.prototype.onLoad = function () {
        this._label = this.node.getComponent(cc.Label);
    };
    ShowTime.prototype.update = function (dt) {
        this._time += dt;
        if (this._time < 1)
            return;
        this._show--;
        this._time = 0;
        if (this._show < -1)
            return;
        if (this._show > 0) {
            this._label.string = this._show + '';
        }
        else if (this._show === 0) {
            this._label.string = 'Go';
        }
        else if (this._show === -1) {
            this._label.string = '';
        }
    };
    ShowTime = __decorate([
        ccclass
    ], ShowTime);
    return ShowTime;
}(cc.Component));
exports.default = ShowTime;

cc._RF.pop();